<include file="Base/header" />
<div class="js-check-wrap">
	<div class="table-actions">
    	<form action="{:U('')}" method="post">
	                   标题：<input type="text" class='input' name="title" value="{$_REQUEST[title]}" size="30" style="margin-right: 20px;">
          ID：<input type="text" class='input' name="proid" value="{$_REQUEST[proid]}" size="8" style="margin-right: 20px;">
 	                   分类：<select name="t_lx" style="margin-right: 20px;">
                   <option value="">--请选择--</option>
                   {:get_cate_select(6,$_REQUEST[t_lx])}
               </select>
	                   推荐类型：<select name="recommend_type" style="margin-right: 20px;">
	                <option value="" >--请选择--</option>
	                <foreach name='recommend_type' item='vo' key='k'>
		                <option value="{$k}" {$_REQUEST['recommend_type'] == "$k" ? selected : '' }>{$vo}</option>
	                </foreach>
	            </select> 
	                   修改次数：<select name="update_num" style="margin-right: 20px;">
	                <option value="" >--请选择--</option>
	                <for start='1' end='6'>
		                <option value="{$i}" {$_REQUEST['update_num'] == "$i" ? selected : '' }>{$i}</option>
	                </for>
	                <option value="6" {$_REQUEST['update_num'] == "6" ? selected : '' }>大于5</option>
	                <option value="7" {$_REQUEST['update_num'] == "6" ? selected : '' }>未修改</option>
	            </select> 
	            
				
	            <button type="submit" class='btn' >搜索</button>
	            <a href="{:U('')}" class='btn' >清空</a>
    	</form>
	</div>
	<form class="wrap js-ajax-form" method='post'>

        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
            <thead>
                <tr>
                	<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                    <th width="50">排序</th>
                    <th width="50">ID</th>
                    <th>产品标题</th>
                    <th>所在分类</th>
                    <th>发布时间</th>
                    <th>推荐类型</th>
                    <th>组合ID</th>
                    <th>修改次数</th>
                    <th width="150">操作</th>
                </tr>
            </thead>
            <volist name="list" id="vo">
                <tr align="center" id="{$vo.id}">
                	<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
                    <td><input name='listorders[{$vo[id]}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
                    <td>{$vo.id}</td>
                    <td class="left"><img src="__PUBLIC__/Img/{$vo.lang}.png"><a href="{:U('edit',['id'=>$vo[id]])}">{$vo.title}</a></td>
                    <td>{:get_cate_name($vo[t_lx])}</td>
                    <td>{$vo.published|date="Y-m-d H:i:s",###}</td>
                    <!-- <td><img src="__ROOT__/Public/Img/action_{$vo.is_recommend}.png" border="0"></td> -->
                    <td>
						<switch name='vo.recommend_type'>
							<case value='1'>{$recommend_type[1]}</case>
							<case value='2'>{$recommend_type[2]}</case>
							<case value='3'>{$recommend_type[3]}</case>
							<default />----
						</switch>
                    </td>
					<td>{$vo[group_id]|default='--'}</td>
					<td>{$vo[update_num]}</td>
                    <td>[ <a href="{:U('edit',['id'=>$vo[id],'do'=>'copy'])}">复制 </a> ][ <a href="{:U('edit',['id'=>$vo[id]])}">编辑 </a> ] [ <a link="{:U('Product/del/',array('id'=>$vo['id']))}" href="javascript:void(0)" name="{$vo.title}" class="del">删除 </a> ]</td>
                </tr>
            </volist>
        </table>
		<div class="commonBtnArea" >
			<button class="btn js-ajax-submit" type="submit" data-action="{:U('listorders')}">排序</button>
<!-- 			<button class="btn js-ajax-submit" type="submit" data-action="{:U('setRecommend',array('value'=>1))}" data-subcheck="true">推荐</button>
			<button class="btn js-ajax-submit" type="submit" data-action="{:U('setRecommend',array('value'=>0))}" data-subcheck="true">取消推荐</button> -->
			<button class="btn js-ajax-submit" type="submit" data-action="{:U('delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>			
			<input type="text" name='groupname' value='' class='input' placeholder='请输入系列名称'/>			
			<button class="btn js-ajax-submit" type="submit" data-action="{:U('createGroup')}" data-subcheck="true" >创建系列</button>			
			<input type="text" name='groupid' value='' class='input' placeholder='请输入系列ID'/>			
			<button class="btn js-ajax-submit" type="submit" data-action="{:U('addtoGroup')}" data-subcheck="true" >添加至系列</button>			
			<div style='float:right'>{$page}</div>
		</div>
    </form>
</div>

<include file="Base/footer" />
<script type="text/javascript">
//组合设置
function setGroupName(){
	layer.open({
		  content: 'test',
		  yes: function(index, layero){
		    //按钮【按钮二】的回调
		  },
		  cancel: function(){ 
		    //右上角关闭回调
		  }
		});
}



    $(function(){
        $(".del").click(function(){
            var delLink=$(this).attr("link");
            $this = $(this);
            popup.confirm('你真的打算删除【<b>'+$(this).attr("name")+'</b>】吗?','温馨提示',function(action){
                if(action == 'ok'){
                    delByLink(delLink,$this);
                }
            });
            return false;
        });
    });



</script>
</body>
</html>
